import 'package:flutter_test/flutter_test.dart';
import 'package:pdf_render_ohos/pdf_render.dart';
import 'package:plugin_platform_interface/plugin_platform_interface.dart';

class MockPdfDocument
    with MockPlatformInterfaceMixin
    implements PdfDocument {

  @override
  Future<void> dispose() {
    throw UnimplementedError();
  }

  @override
  bool get allowsCopying => true;

  @override
  bool get allowsPrinting => false;

  @override
  Future<PdfPage> getPage(int pageNumber) {
    throw UnimplementedError();
  }

  @override
  bool get isEncrypted => true;

  @override
  int get pageCount => 10;

  @override
  String get sourceName => 'ohos';

  @override
  int get verMajor => 20;

  @override
  int get verMinor => 30;
}

void main() {
  MockPdfDocument pdfDocument = MockPdfDocument();

  test('allowsCopying', () async {
    expect(pdfDocument.allowsCopying, true);
  });

  test('allowsPrinting', () async {
    expect(pdfDocument.allowsPrinting, false);
  });

  test('isEncrypted', () async {
    expect(pdfDocument.isEncrypted, true);
  });

  test('pageCount', () async {
    expect(pdfDocument.pageCount, 10);
  });

  test('sourceName', () async {
    expect(pdfDocument.sourceName, 'ohos');
  });

  test('verMajor', () async {
    expect(pdfDocument.verMajor, 20);
  });

  test('verMinor', () async {
    expect(pdfDocument.verMinor, 30);
  });
}
